package dk.itu.mario.MarioInterface;

public class LevelContent {
	
	public int levelLength;
	public int numRedTurtles, numGreenTurtles, numArmoredTurtles, numGoombas;
	public int numCannonBalls, numJumpFlowers, numChompFlowers;
	
	public LevelContent(GamePlay g) {
		numRedTurtles = numEnemies(g.RedTurtlesKilled,g.timesOfDeathByRedTurtle);
		numGreenTurtles = numEnemies(g.GreenTurtlesKilled,g.timesOfDeathByGreenTurtle);
		numArmoredTurtles = numEnemies(g.ArmoredTurtlesKilled,g.timesOfDeathByArmoredTurtle);
		numGoombas = numEnemies(g.GoombasKilled,g.timesOfDeathByGoomba);
		numCannonBalls = numEnemies(g.CannonBallKilled,g.timesOfDeathByCannonBall);
		numJumpFlowers = numEnemies(g.JumpFlowersKilled,g.timesOfDeathByJumpFlower);
		numChompFlowers = numEnemies(g.ChompFlowersKilled,g.timesOfDeathByChompFlower);
	}
	
	private int numEnemies(int kills, int deaths) {
		return Math.max(2 * kills - 20 * deaths, 1);
	}
	
}
